home *** CD-ROM | disk | FTP | other *** search
- #ifndef _animcursor_
- #define _animcursor_
- /***************************************************************************************************\
- * AnimCursor - The Animated Cursor Library
- *
- * AnimCursor is a small library of four routines which allow a program to animate the cursor by
- * showing a series of CURS or crsr resources. Resources of the type 'acur' are used to keep a list
- * of the cursors which will be displayed during the cursor animation. The acur resource was
- * introduced a few Finders ago to animate the watch cursor.
- *
- * The acur resource doesn’t contain the cursors themselves. Instead, it contains a list of the
- * the resource IDs of the CURS or crsr resources to be used. The structure of an acur resource is
- * like this:
- *
- * 2 bytes - This is the number of cursors to be used in the animation
- * 2 bytes - The lowest 15 bits of this field is the index in the cursor list of the next cursor to
- * be used in the animation. In the resource file, you should place the index in the
- * cursor list of the first cursor to be displayed in the animation. The highest bit is a
- * flag. If you clear this bit, CURS resources will be used in the animation. If you set
- * this bit, crsr (color cursor) resources will be used.
- * The Rest - This is the cursor list. It holds as many elements as the count field indicates. Each
- * element is four bytes long. The first two bytes of each element holds the resource ID
- * of the CURS or crsr resource to use. The other two bytes are padding. When the acur
- * resource is in memory, these two padding bytes and the two bytes for the CURS or crsr
- * resource ID are combined to hold a handle to the CURS or crsr in memory.
- \***************************************************************************************************/
-
-
- /***************************************************************************************************\
- * Header Files
- \***************************************************************************************************/
-
- #ifndef __QUICKDRAW__
- #include <Quickdraw.h>
- #endif
-
-
- /***************************************************************************************************\
- * Type Declarations
- \***************************************************************************************************/
-
- /* acur Resource Template */
- typedef struct
- {
- short count; /* Number of cursors or “frames” in the cursor list */
- short frame; /* Cursor list index of the next cursor frame */
- CursHandle cursors []; /* Variable-sized list of cursor handles */
- } AnimCursRec, *AnimCursPtr, **AnimCursHnd;
-
-
- /***************************************************************************************************\
- * Function Prototypes
- *
- * GetAnimCurs
- * -----------
- * A handle to the animated cursor list having the resource ID given in AnimCursID and the
- * resource type of 'acur' is returned. The cursor list contains a list of resource IDs of the
- * cursors to use. GetAnimCurs will read in each CURS or crsr resource and replace the resource ID
- * in the list with a handle to the corresponding CURS or crsr resource. If the high bit of the frame
- * field is set, GetAnimCurs will load in crsr resources, otherwise it will load in CURS resources.
- *
- * AnimateCurs
- * -----------
- * The animated cursor list specified by AnimCurs is advanced one frame. This displays the cursor
- * whose handle in the cursor list is at the index specified by the frame field. The frame field is
- * then incremented. If the frame field is incremented past the end of the cursor list, it is wrapped
- * around to the beginning of the list again. The high bit of the frame field (indicating whether to
- * use CURS or crsr resources) is retained.
- *
- * Example:
- * FOR I := 1 TO 500 DO
- * AnimateCurs (MyCursList);
- *
- * This example will simply display 500 frames of the animated cursor list specified by
- * MyCursList.
- *
- * AnimateProgCurs
- * ---------------
- * One frame of the cursor list specified by AnimCurs is displayed depending on the value of Val.
- * This call can be used to have to cursor display the progress of a long operation. Min specifies
- * the minimum value of Val, Max specifies the maximum value of Val, and (of course) Val is the
- * current value of Val. If, for example, Min = 1, Max = 500, and Val = 100, and AnimCurs contains
- * ten cursors, AnimateProgCurs will display the second cursor. The value of the frame field is
- * unchanged.
- *
- * Example:
- * Min := 1;
- * Max := 500;
- * FOR Val := Min TO Max DO
- * AnimateProgCurs (MyCursList, Min, Max, Val);
- *
- \***************************************************************************************************/
-
- pascal AnimCursHnd GetAnimCurs (short AnimCursID);
- pascal void AnimateCurs (AnimCursHnd AnimCurs);
- pascal void AnimateProgCurs (AnimCursHnd AnimCurs, short Min, short Max, short Val);
- pascal void DisposeAnimCurs (AnimCursHnd AnimCurs);
-
-
- #endif
-